<template>
	<view class="content">
		<web-view src="https://cdjjyl.com.cn/iot-platform-uniapp/#/pages/face/face-mainpage?communityId=2021033107540006&memberId=6810184439180824576">
		</web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				communityId: this.$api.util.getAreaCode(),
				userId: "",
				url: "https://cdjjyl.com.cn/iot-platform-uniapp/#/pages/face/face-mainpage",
			}
		},
		created(options) {
			let userId = uni.getStorageSync('userInfo').userUuid;
			if (userId != null & userId != '') {
				this.userId = userId
			}
			this.getOwnerIdByUserIdAndCommunityId()
		},
		methods: {
			getOwnerIdByUserIdAndCommunityId() {
				let params = {
					userId: this.userId,
					communityId: this.communityId
				}
				this.$api.request.getOwnerUserInfoByUserIdAndCommunityId(params, (res) => {
                    if(res.body.status.statusCode == "0"){
						if(res.body.data.entity == null){
							this.$api.msg("未查询到绑定信息")
						}else{
							this.url += "?communityId="+this.communityId+"&memberId="+res.body.data.entity.memberId
						}
					}else{
						this.$api.msg("系统错误")
					}
				})
			}
		}
	}
</script>

<style>
	page {
		height: 100%;
		width: 100%;
	}
</style>
